<template>
	<view class="container-wrapper">
		<view class="banner-wrapper">
			<u--image :showLoading="true" src="/static/index_banner.png" width="100%" height="auto"
				mode="widthFix"></u--image>
		</view>
		<view class="content-wrapper column-center">
			<view @click="onRedirTo('/registration/index')">
				<u--image :showLoading="true" src="/static/2.png" width="616rpx" height="144rpx"></u--image>
			</view>
			<view class="mt38" @click="onRedirTo('/disposal/index')">
				<u--image :showLoading="true" src="/static/1.png" width="616rpx" height="144rpx"></u--image>
			</view>
		</view>
		<uniLoading v-if="loadingCover" bgColor="#fff"></uniLoading>
	</view>
</template>

<script>
	import {
		getInfoApi
	} from '@/apis/common.js';
	export default {
		data() {
			return {
				title: 'Hello',
				loadingCover: true,
			}
		},
		onLoad() {
			// this.getInfo();
			setTimeout(() => {
				this.loadingCover = false;
			}, 500)
		},
		methods: {
			onRedirTo(path) {
				this.$commonUtil.redirectTo(path);
			},
			async getInfo() {
				try {
					let resp = await getInfoApi();
					let campusList = [{
						name: '华西',
						code: 1
					}, {
						name: '望江',
						code: 2
					}, {
						name: ' 江安',
						code: 3
					}];
					let campusObj = campusList.findObj((val) => {
						return val.code == resp.campus
					});
					uni.setStorageSync('campus', resp.campus);
					uni.setStorageSync('campusName', campusObj.name);
				} catch (e) {
					console.log(`获取用户信息${e.message}`, 'background:orange')
				}
			},
		}
	}
</script>

<style scoped lang="scss">
	.container-wrapper {
		width: 100%;
		min-height: 100%;
		background: #fff;

		.banner-wrapper {
			width: 100%;

		}

		.content-wrapper {
			margin-top: 42rpx;
			text-align: center;
		}
	}
</style>